﻿namespace CRM.Business.Services
{
    using System.Collections.Generic;
    using CRM.DataAccess.DAOs;
    using CRM.DataAccess.Entities;
    using System;

    public static class InvoiceService
    {
        private static InvoiceDAO InvoiceDAO = new InvoiceDAO();

        //Delete Invoice
        public static int DeleteInvoice(long invoiceID)
        {
            return InvoiceDAO.DeleteInvoice(invoiceID);
        }
        // get Invoice status by ID
        public static INVOICE_STATUS GetInvoiceStatusByID(long? ID)
        {
            return InvoiceDAO.GetInvoiceStatusByID(ID);
        }
        //get  Invoice by ID
        public static INVOICE GetInvoiceByID(long? ID)
        {
            return InvoiceDAO.GetInvoiceByID(ID);
        }
        // get all Invoice Status
        public static List<INVOICE_STATUS> GetAllInvoiceStatus()
        {
            return InvoiceDAO.GetAllInvoiceStatus();
        }
        //Get Invoice By ID
        public static INVOICE_DETAIL GetInvoiceDetailByID(long id, long? assignedToID)
        {
            return InvoiceDAO.GetInvoiceDetailByID(id, assignedToID);
        }
       
        //add new Invoice
        public static int AddNewInvoice(INVOICE invoice, ITEM item, List<ITEM_DETAIL> itemDetails)
        {
            return InvoiceDAO.AddNewInvoice(invoice, item, itemDetails);
        }
        //Update Invoice
        public static int UpdateInvoice(INVOICE invoice, ITEM item, List<ITEM_DETAIL> itemDetails)
        {
            return InvoiceDAO.UpdateInvoice(invoice, item, itemDetails);
        }
        //Get invoice by condition
        public static List<INVOICE_DETAIL> GetInvoiceByCondition(DateTime? dateFrom, DateTime? dateTo, long? status_ID, List<long?> ListConID, List<long?> ListOrgID, long? assignUser_ID)
        {
            return InvoiceDAO.GetInvoiceByCondition(dateFrom, dateTo, status_ID, ListConID, ListOrgID, assignUser_ID);
        }
     
    }
}